#!/usr/bin/python
# -*- coding: UTF-8 -*-
#cron:8 8,15 * * *
import requests
import base64
import json
import time
import notify2
import os
import sys
import random
t = time.time()
timestamp = int(round(t * 1000))


# 定义两个账号信息，实际应用中可根据需要扩展账号数量
# 从环境变量中获取账号密码信息
env_accounts_info = os.environ.get('xiwo')

# 解析环境变量中的账号密码信息，存储为账号字典列表
accounts = []
if env_accounts_info:
    account_pairs = env_accounts_info.split('@')
    for pair in account_pairs:
        username, password = pair.split('&')
        accounts.append({'username': username, 'password': password})
else:
    print("环境变量中未获取到账号密码信息，请检查设置！")

# 根据账号获取token
def token(account):
    headers = {
        'Cookie': 'x-auth-app=EasiNote5; x-auth-token=; acw_tc=1a0c595817308041547308041547398024e00e398f9ff3f4cdf743e11908bdb62cff81d',
        'X-APM-TraceId': '6a7e4cf4c71645dfb92c37d12f17709',
        'Content-Type': 'application/json; charset=utf-8',
        'Content-Length': '109'}
    payload1 = base64.b64decode(account['password'])
    html = requests.request("POST", "https://edu.seewo.com/api/v1/auth/login", headers=headers, data=payload1)
    a = json.loads(html.text)
    token = a["data"]["token"]
    print(f'获取账号 {account["username"]} 的最新token：{token}')
    return token
#获取今天的积分
def huoqujinrijifen(token):

    headers = {
     'sec-ch-ua-platform':'"Android"',
     'x-csrf-token':'68SLf9bd1QXdadvydnPg5ICQ',
     'x-kish-token-key':'token',
     'user-agent':'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Mobile Safari/537.36 Edg/131.0.0.0',
     'accept':'application/json, text/plain, */*',
     'sec-ch-ua':'"Microsoft Edge";v="131", "Chromium";v="131", "Not_A Brand";v="24"',
     'sec-ch-ua-mobile':'?1',
     'sec-fetch-site':'same-origin',
     'sec-fetch-mode':'cors',
     'sec-fetch-dest':'empty',
     'referer':'https://m.seewoedu.cn/college/exchange/my',
     'accept-encoding':'gzip, deflate, br, zstd',
     'accept-language':'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
     'priority':'u=1, i',
     'cookie':f'csrfToken=68SLf9bd1QXdadvydnPg5ICQ; Hm_lvt_28e60218260284b8df3efca2fc9f65ad=1732188474; HMACCOUNT=42209AB7FA95880B; prfb=0Vw8EI77pz6LEVIw8Kp/mi2mFgyBy/PnJwG5LcMcHQniKO6ASIOsrsi8KUDxz/Uu; prfb.sig=8T0qoDo0AF31FJsU8IKLt20pyX-7LPsBDxG5P_nOmNY; prfbe=1; prfbe.sig=YigtUW3dSaV9Z4-j9W4uoyH2ZwLPlLNJzZCP_Mnfdt4; token={token}; token.sig=s4z7Vs4MduK0M7z6dLwhzppOOIVPbEkySeaFaAWTWgE; isLogin=true; isLogin.sig=6cEa4OH0TcIMNn5kN4nya3RJcZZkb-5Q5Afzqx1MZns; userName=15779752720; userId=5f20ea0cfbff401dbb7119eb7cf7d530; stageName=%E5%B0%8F%E5%AD%A6; stageId=CodeSchoolStage_0; subjectName=%E4%BF%A1%E6%81%AF%E7%A7%91%E6%8A%80; subjectId=CodeCourseSubject_16; ab_uid=5f20ea0cfbff401dbb7119eb7cf7d530; acw_tc=1a0c595b17321911471201048e003c20931109a7c6029c12b2b4563c6cfac9; Hm_lpvt_28e60218260284b8df3efca2fc9f65ad=1732191107'}
    payload=None

    response0 = requests.request("GET", "https://m.seewoedu.cn/apiv3/v1/tasks/integration/revenues?time=1732191132794-c5fcWiJMom5Unp50fzBpr&type=1&page=0&size=10", headers=headers, data=payload)
    data = response0.json()
    import json
    from datetime import datetime

    # 获取积分数据列表
    integration_datas = data["data"]["integrationDatas"]

    # 获取今天的日期，格式化为'YYYY-MM-DD'
    today = datetime.now().strftime('%Y-%m-%d')

    # 用于累加当天积分总和的变量
    total_integration_today = 0
    msg_list = []
    for item in integration_datas:
        if item["createTime"] == today:
            msg_list.append({
                "name": item["name"],
                "integration": item["integration"],
                "createTime": item["createTime"]
            })

    # 将列表中的字典元素转换为字符串格式，并添加换行符，拼接成最终的字符串
    msg = ""
    for element in msg_list:
        msg += f"name: {element['name']}, integration: {element['integration']}, createTime: {element['createTime']}\n"

    print(msg)
    zongjifen = data["data"]["totalIntegration"]
    # 遍历积分数据列表，判断日期并累加积分
    for item in integration_datas:
        if item["createTime"] == today:
            total_integration_today += item["integration"]

    print(total_integration_today)
    return total_integration_today,zongjifen,msg
def qiandao(token):
    headers = {
        'content-length': '20',
        'sec-ch-ua': '"Chromium";v="122", "Not(A:Brand";v="24", "Google Chrome";v="122"',
        'x-csrf-token': 'HpCPNJRNFF7Pofs6etod1jvd',
        'sec-ch-ua-mobile': '?1',
        'user-agent': 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.6261.95 Mobile Safari/537.36',
        'content-type': 'application/json',
        'accept': 'application/json, text/plain, */*',
        'x-kish-token-key': 'token',
        'sec-ch-ua-platform': '"Android"',
        'origin': 'https://m.seewoedu.cn',
        'sec-fetch-site': 'same-origin',
        'sec-fetch-mode': 'cors',
        'sec-fetch-dest': 'empty',
        'referer': 'https://m.seewoedu.cn/college/exchange/home',
        'accept-encoding': 'gzip, deflate, br',
        'accept-language': 'zh-CN,zh;q=0.9',
        'cookie': f'acw_tc=ac11000117307239727058878e0047314ee9b15fdd02b4c5edec4192139752; csrfToken=HpCPNJRNFF7Pofs6etod1jvd; Hm_lvt_28e60218260284b8df3efca2fc9f65ad=1730723938; HMACCOUNT=3323316B7FE79462; prfb=0bZkD9FL2YHaxRA5JgIo0w/+Bnq9gc9uS/weQEcjkLYcOEZ1AJsG/I4tDCW1wGB3; prfb.sig=MzxvEP5V92_nnm75oVsNTpsOonJHwTB2uDUupu7t9bw; prfbe=1; prfbe.sig=EkUBoLJrN8CglDbsu17Kvk7W2APZDlVAQbDmjBSMFGw; token={token}; token.sig=PxvbgoORREd62tjdA1zFtyhl_i8J0fVBO3wf55RHnFg; isLogin=true; isLogin.sig=6cEa4OH0TcIMNn5kN4nya3RJcZZkb-5Q5Afzqx1MZns; userName=15779752720; userId=5f20ea0cfbff401dbb7119eb7cf7d530; stageName=%E5%B0%8F%E5%AD%A6; stageId=CodeSchoolStage_0; subjectName=%E4%BF%A1%E6%81%AF%E7%A7%91%E6%8A%80; subjectId=CodeCourseSubject_16; Hm_lpvt_28e60218260284b8df3efca2fc9f65ad=1730724126; ab_uid=5f20ea0cfbff401dbb7119eb7cf7d530'}
    payload = base64.b64decode("eyJ0eXBlIjoiZGFpbHlTaWduIn0=")

    response0 = requests.request("POST","https://m.seewoedu.cn/apiv3/v1/tasks/finished?time=1730724360551-ups5X3GrDEZZPEu_cA2yc",headers=headers, data=payload)
    qiandaojieguo = response0.json()["message"]
    msg = f'签到结果：{qiandaojieguo}'
    return msg

def chaxun(token):
      headers = {
       'sec-ch-ua-platform':'"Android"',
       'x-csrf-token':'_f-wgjgxqQa3sniq9kOJXgHd',
       'x-kish-token-key':'token',
       'sec-ch-ua':'"Chromium";v="130", "Microsoft Edge";v="130", "Not?A_Brand";v="99"',
       'sec-ch-ua-mobile':'?1',
       'baggage':'sentry-environment=PRO,sentry-release=seewoedu-college-v3-mobile-997e0de2,sentry-public_key=a47500a7302c47b9bda4fe40bd6451cb,sentry-trace_id=fa82497fd8d94fbb9ac0b4b8aee0989e,sentry-sample_rate=0.4',
       'sentry-trace':'fa82497fd8d94fbb9ac0b4b8aee0989e-bd85e331dde26193-1',
       'user-agent':'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Mobile Safari/537.36 Edg/130.0.0.0',
       'accept':'application/json, text/plain, */*',
       'sec-fetch-site':'same-origin',
       'sec-fetch-mode':'cors',
       'sec-fetch-dest':'empty',
       'referer':'https://m.seewoedu.cn/college/exchange/home',
       'accept-encoding':'gzip, deflate, br, zstd',
       'accept-language':'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
       'priority':'u=1, i',
       'cookie':f'acw_tc=0aef382417315771943572748e00f9342d2be54db12fffce7f82f225656b54; csrfToken=_f-wgjgxqQa3sniq9kOJXgHd; Hm_lvt_28e60218260284b8df3efca2fc9f65ad=1731577187; HMACCOUNT=61F74BFE12EEC21A; prfb=HTF0yM2B55FIfM5m4LvMdP9HSLEEIIDvqHEJ6hU04DF9ImeiXeXwR8d01z5BguoE; prfb.sig=MLqXcgNLj6tdAn4qotmwpJB1BaVZY8jmWOZAbCTfCYI; prfbe=1; prfbe.sig=YigtUW3dSaV9Z4-j9W4uoyH2ZwLPlLNJzZCP_Mnfdt4; token={token}; token.sig=nzxVXlWHId7BfHQ5MwbV1JX84H5STGCSqMiwnSL17fg; isLogin=true; isLogin.sig=6cEa4OH0TcIMNn5kN4nya3RJcZZkb-5Q5Afzqx1MZns; userName=19179035752; userId=xvpkuxgtnluprrgwgljpsoj512833941; stageName=%E5%B0%8F%E5%AD%A6; stageId=CodeSchoolStage_0; subjectName=%E8%AF%AD%E6%96%87; subjectId=CodeCourseSubject_0; ab_uid=xvpkuxgtnluprrgwgljpsoj512833941; Hm_lpvt_28e60218260284b8df3efca2fc9f65ad=1731577647'}
      payload=None

      response0 = requests.request("GET", "https://m.seewoedu.cn/apiv3/v1/tasks/daily?time=1731577647516-t1u4ANbFtrWd05JAv1Ith", headers=headers, data=payload)
      qiandaotianshu = response0.json()["data"]["totalSignCount"]
      zongjifen = response0.json()["data"]["totalIntegration"]
      msg = f'签到天数：{qiandaotianshu}天\n现在积分:{zongjifen}\n'
      print(msg)
      return msg,zongjifen
def kanshipin(token):

    headers = {
        'content-length': '115',
        'sec-ch-ua': '"Chromium";v="122", "Not(A:Brand";v="24", "Google Chrome";v="122"',
        'x-csrf-token': '5yvewwYvdM4KcpE9Bz8Gl9wN',
        'sec-ch-ua-mobile': '?1',
        'user-agent': 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.6261.95 Mobile Safari/537.36',
        'content-type': 'application/json',
        'accept': 'application/json, text/plain, */*',
        'x-kish-token-key': 'token',
        'sec-ch-ua-platform': '"Android"',
        'origin': 'https://m.seewoedu.cn',
        'sec-fetch-site': 'same-origin',
        'sec-fetch-mode': 'cors',
        'sec-fetch-dest': 'empty',
        'referer': 'https://m.seewoedu.cn/tCourse/group/db566b09d7f34d1ea2485492259a1a50/course/6e4b2330b1d4443b8173f293f1f63902?channel=',
        'accept-encoding': 'gzip, deflate, br',
        'accept-language': 'zh-CN,zh;q=0.9',
        'cookie': f'prfb=0bZkD9FL2YHaxRA5JgIo0w/+Bnq9gc9uS/weQEcjkLYcOEZ1AJsG/I4tDCW1wGB3; prfb.sig=MzxvEP5V92_nnm75oVsNTpsOonJHwTB2uDUupu7t9bw; prfbe=1; prfbe.sig=EkUBoLJrN8CglDbsu17Kvk7W2APZDlVAQbDmjBSMFGw; token={token}; token.sig=PxvbgoORREd62tjdA1zFtyhl_i8J0fVBO3wf55RHnFg; isLogin=true; isLogin.sig=6cEa4OH0TcIMNn5kN4nya3RJcZZkb-5Q5Afzqx1MZns; userId=5f20ea0cfbff401dbb7119eb7cf7d530; stageName=%E5%B0%8F%E5%AD%A6; stageId=CodeSchoolStage_0; subjectName=%E4%BF%A1%E6%81%AF%E7%A7%91%E6%8A%80; subjectId=CodeCourseSubject_16; csrfToken=5yvewwYvdM4KcpE9Bz8Gl9wN; Hm_lvt_28e60218260284b8df3efca2fc9f65ad=1730723938,1730765485; HMACCOUNT=3323316B7FE79462; ab_uid=5f20ea0cfbff401dbb7119eb7cf7d530; Hm_lpvt_28e60218260284b8df3efca2fc9f65ad=1730782275; channel=; acw_tc=ac11000117307858498387145e00975a42148d2c219fe9281d37b4f62cf185'
            }

    payload = base64.b64decode("eyJjb3Vyc2VHcm91cFVpZCI6ImRiNTY2YjA5ZDdmMzRkMWVhMjQ4NTQ5MjI1OWExYTUwIiwiY291cnNlVWlkIjoiNmU0YjIzMzBiMWQ0NDQzYjgxNzNmMjkzZjFmNjM5MDIiLCJjYW1wVWlkIjpudWxsfQ==")
    payload1 = base64.b64decode("eyJjb3Vyc2VHcm91cFVpZCI6ImRiNTY2YjA5ZDdmMzRkMWVhMjQ4NTQ5MjI1OWExYTUwIiwiY291cnNlVWlkIjoiMzUzNTA1ZWUzZDU3NGI2NjkyYmE4MDdiMjY0ZDQ1OTMiLCJjYW1wVWlkIjpudWxsfQ==")
    payload2 = base64.b64decode("eyJjb3Vyc2VHcm91cFVpZCI6ImRiNTY2YjA5ZDdmMzRkMWVhMjQ4NTQ5MjI1OWExYTUwIiwiY291cnNlVWlkIjoiMTUwZjkxMDU3ZWUyNDdiYjg3NDE3OTMzNWJmYjc3MmYiLCJjYW1wVWlkIjpudWxsfQ==")
    payload3 = base64.b64decode("eyJjb3Vyc2VHcm91cFVpZCI6ImRiNTY2YjA5ZDdmMzRkMWVhMjQ4NTQ5MjI1OWExYTUwIiwiY291cnNlVWlkIjoiYmQ5NGY3NjY1MDhmNDBlMTgyNjEyZWVlOWY0MmViZjQiLCJjYW1wVWlkIjpudWxsfQ==")
    payload4 = base64.b64decode("eyJjb3Vyc2VHcm91cFVpZCI6ImRiNTY2YjA5ZDdmMzRkMWVhMjQ4NTQ5MjI1OWExYTUwIiwiY291cnNlVWlkIjoiODk2NmQ2NTYxNzEzNDA3ODg5M2QyZWY3Yzk1YzAwNTciLCJjYW1wVWlkIjpudWxsfQ==")
    payload5 = base64.b64decode("eyJjb3Vyc2VHcm91cFVpZCI6IjIyNTdhNmViM2IzMDRhMmM4NDdlMTJhZTZiMWVlOWNmIiwiY291cnNlVWlkIjoiNjFhZjEwNDFiNzU2NDJmZmIyYWUxN2U4YjYwZGFjYjYiLCJjYW1wVWlkIjpudWxsfQ==")
    payload6 = base64.b64decode("eyJjb3Vyc2VHcm91cFVpZCI6IjIyNTdhNmViM2IzMDRhMmM4NDdlMTJhZTZiMWVlOWNmIiwiY291cnNlVWlkIjoiZThmZmIxNzEzYzczNGNjYjhjNzhhYTc1ZmU1MDMxZTYiLCJjYW1wVWlkIjpudWxsfQ==")
    payload7 = base64.b64decode("eyJjb3Vyc2VHcm91cFVpZCI6IjIyNTdhNmViM2IzMDRhMmM4NDdlMTJhZTZiMWVlOWNmIiwiY291cnNlVWlkIjoiMTA0YzRhOWQ3ZGJjNDliMWIxMDg2YzZlZWRkOWJkNGYiLCJjYW1wVWlkIjpudWxsfQ==")
    payload8 = base64.b64decode("eyJjb3Vyc2VHcm91cFVpZCI6IjIyNTdhNmViM2IzMDRhMmM4NDdlMTJhZTZiMWVlOWNmIiwiY291cnNlVWlkIjoiMTA0YzRhOWQ3ZGJjNDliMWIxMDg2YzZlZWRkOWJkNGYiLCJjYW1wVWlkIjpudWxsfQ==")
    '''
    response0 = requests.request("POST","https://m.seewoedu.cn/apiv3/v1/studyLogs/study?time=1730785992915-H350-HUTGPCjnZHD0xUb-",headers=headers, data=payload)
    print(response0.text)
    response1 = requests.request("POST","https://m.seewoedu.cn/apiv3/v1/studyLogs/study?time=1730786757533-03XYu8U75XQTRnB4f7Pp3",headers=headers, data=payload1)
    print(response1.text)
    response2 = requests.request("POST","https://m.seewoedu.cn/apiv3/v1/studyLogs/study?time=1730787429229-fZee3H1IEt_tvi1TX8gwe",headers=headers, data=payload2)
    print(response2.text)
    response3 = requests.request("POST","https://m.seewoedu.cn/apiv3/v1/studyLogs/study?time=1730787953100-d76eiCA4jWpacBKB7Ccao",headers=headers, data=payload3)
    print(response3.text)
    '''
    payloads=[payload,payload1,payload2,payload3,payload4,payload5,payload6,payload7,payload8]
    n=1
    m=1
    msg = ''
    msg +=f'--------🌸视频任务开始({account["username"]})🌸-------\n'
    for i in payloads:
        response0 = requests.request("POST","https://m.seewoedu.cn/apiv3/v1/studyLogs/study?time=1730785992915-H350-HUTGPCjnZHD0xUb-",headers=headers, data=i)
        time.sleep(random.random() * 100)
        msg += f'第{n}次看视频：{response0.json()["message"]}\n'
        print(response0.text)
        n+=1

    '''
    msg = ''
    n=1
    m=1
    # 视频观看
    courseuid = ["b862a7d1949940f5846f19530b43426c", "8187f3e5f1c74c16a79ee0b4b86b8166","8a1995a87d3048899fe37cd08250801d", "fc629e8d5d844452973fb04cb1edfe92"]
    url = f'https://study.seewoedu.cn/apis/v1/studyLogs/study?time={timestamp}-3bOnzjGVUFD'
    for i in courseuid:
        data = {"courseGroupUid": "0d55b3455c5c4b32980a2eadab7c0e68", "courseUid": i, "campUid": None, }
        # time.sleep(number)
        html = requests.post(url, headers=headers, data=json.dumps(data))
        print(html.text)
        msg += f'第{n}次看视频：{html.json()["data"]["message"]}\n'
        n+=1
        #print(len(html.text))
        #print(html.text)
    '''
    # 每日分享
    msg +=f'\n--------🌸分享任务开始({account["username"]})🌸-------\n'
    extrauid = ["3b09fab90eb9473dac24f7d4857c680e", "4097c01e174f4b4a84afa6ed9a869a85","7cecd8ec546d45179f99c35a6e7f8b0f"]
    for h in extrauid:
        # time.sleep(number)
        res1 = requests.post(url=f'https://m.seewoedu.cn/apiv3/v1/tasks/finished?time={timestamp}-6b0ZBxklQ4tPlBKxeTogi',json={"type": "shareVideo", "extraUid": h}, headers=headers)
        time.sleep(random.random() * 100)
        msg += f'第{m}次分享视频：{res1.json()["message"]}\n'
        m+=1
        #print(res1.text)
    #params = {'time': "1641478567217-aECsI5BsYJVhNUMA42wUS"}
    # res2 = requests.get(url=f'https://m.seewoedu.cn/apiv3/v1/course/groups/0d55b3455c5c4b32980a2eadab7c0e68/scores/my?time=1641478567217-aECsI5BsYJVhNUMA42wUS',headers=headers)
    # print(res2.text)
    print(msg)
    return msg


    #msg += f'第2次看视频：{response1.json()["message"]}\n'
    #msg += f'第3次看视频：{response2.json()["message"]}\n'
    #msg += f'第4次看视频：{response3.json()["message"]}\n'
 #print(msg)
 #return msg

def lingqujiangli(token):
    # 领视频
    '''
    headers = {
        'content-length': '0',
        'sec-ch-ua': '"Chromium";v="122", "Not(A:Brand";v="24", "Google Chrome";v="122"',
        'accept': 'application/json, text/plain, */*',
        'x-csrf-token': '5yvewwYvdM4KcpE9Bz8Gl9wN',
        'sec-ch-ua-mobile': '?1',
        'x-kish-token-key': 'token',
        'user-agent': 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.6261.95 Mobile Safari/537.36',
        'sec-ch-ua-platform': '"Android"',
        'origin': 'https://m.seewoedu.cn',
        'sec-fetch-site': 'same-origin',
        'sec-fetch-mode': 'cors',
        'sec-fetch-dest': 'empty',
        'referer': 'https://m.seewoedu.cn/college/exchange/home',
        'accept-encoding': 'gzip, deflate, br',
        'accept-language': 'zh-CN,zh;q=0.9',
        'cookie': f'prfb=0bZkD9FL2YHaxRA5JgIo0w/+Bnq9gc9uS/weQEcjkLYcOEZ1AJsG/I4tDCW1wGB3; prfb.sig=MzxvEP5V92_nnm75oVsNTpsOonJHwTB2uDUupu7t9bw; prfbe=1; prfbe.sig=EkUBoLJrN8CglDbsu17Kvk7W2APZDlVAQbDmjBSMFGw; token={token}; token.sig=PxvbgoORREd62tjdA1zFtyhl_i8J0fVBO3wf55RHnFg; isLogin=true; isLogin.sig=6cEa4OH0TcIMNn5kN4nya3RJcZZkb-5Q5Afzqx1MZns; userId=5f20ea0cfbff401dbb7119eb7cf7d530; stageName=%E5%B0%8F%E5%AD%A6; stageId=CodeSchoolStage_0; subjectName=%E4%BF%A1%E6%81%AF%E7%A7%91%E6%8A%80; subjectId=CodeCourseSubject_16; csrfToken=5yvewwYvdM4KcpE9Bz8Gl9wN; Hm_lvt_28e60218260284b8df3efca2fc9f65ad=1730723938,1730765485; HMACCOUNT=3323316B7FE79462; ab_uid=5f20ea0cfbff401dbb7119eb7cf7d530; acw_tc=ac11000117307902362024680e00f917b25c0dcbd88f210cbe55b77afc7ddf; channel=mstj; Hm_lpvt_28e60218260284b8df3efca2fc9f65ad=1730790386'}
    payload = None
    response0 = requests.request("PUT","https://m.seewoedu.cn/apiv3/v1/tasks/f02070d106c94655b7ae5e8df31d28cb/integral?time=1730790414244-tnSmoq5OmBnB7ljdBgxqH",headers=headers, data=payload)
    print(response0.text)
    '''
    headers2 = {
        'Host': 'm.seewoedu.cn',
        'Connection': 'keep-alive',
        'Content-Length': '0',
        'Accept': 'application/json,text/plain,*/*',
        'x-auth-token': '',
        'x-csrf-token': 'GJMwTaGLAyPB8Xx-bdIDe8Bj',
        'traceparent': '00-4ed7c6024da2657b19effb7909462251-fb171e3139a2be3d-01',
        'User-Agent': 'Mozilla/5.0(Linux;Android6.0;Nexus5Build/MRA58N)AppleWebKit/537.36(KHTML,likeGecko)Chrome/86.0.4240.198MobileSafari/537.36',
        'Origin': 'https://m.seewoedu.cn',
        'Sec-Fetch-Site': 'same-origin',
        'Sec-Fetch-Mode': 'cors',
        'Sec-Fetch-Dest': 'empty',
        'Referer': 'https://m.seewoedu.cn/college/exchange/home',
        'Accept-Encoding': 'gzip,deflate,br',
        'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8',
        'Cookie': f'csrfToken=GJMwTaGLAyPB8Xx-bdIDe8Bj;Hm_lvt_28e60218260284b8df3efca2fc9f65ad=1657093789;prfb=ERoxU7M96nUxopq7l+3qiv/BqJF/Hq9VUa2ewqB9CXFMYz0fEdjzkkGuzKP6p3kP;prfb.sig=MGgEKXzUnKg2pfIMFJ0satNK0jpFupmJgdpyWeKLPFs;prfbe=1;prfbe.sig=EkUBoLJrN8CglDbsu17Kvk7W2APZDlVAQbDmjBSMFGw;isLogin.sig=6cEa4OH0TcIMNn5kN4nya3RJcZZkb-5Q5Afzqx1MZns;userName=15779752720;userId=5f20ea0cfbff401dbb7119eb7cf7d530;stageName=%E5%B0%8F%E5%AD%A6;stageId=CodeSchoolStage_0;subjectName=%E4%BF%A1%E6%81%AF%E6%8A%80%E6%9C%AF;subjectId=CodeCourseSubject_16;ab_uid=5f20ea0cfbff401dbb7119eb7cf7d530;token={token};token.sig=GtcGSuqh0haCvY_Qw2Mwxz1oHZ_fnFYMVNTEq7vSrqI;isLogin=true;_csrf=5SAK8vDDpBHVmRM3ut_ZtHmx;sw_sid=user_t8sK1dY6BYFbiKqpqHhy7YNwkFVTYXIo;acw_tc=2f624a1c16571089399464268e66fb5812b97420ad608efbabfa6bf477e7f4;Hm_lpvt_28e60218260284b8df3efca2fc9f65ad=1657109110',

    }
    renwuid = ['8c88adf480e34dd9b53761a980243d16','f02070d106c94655b7ae5e8df31d28cb']
    msg = ''
    for i in renwuid:
        url = f'https://m.seewoedu.cn/apis/v1/tasks/{i}/integral?time={timestamp}-3sN0gvUM5AY'
        print(url)
        time.sleep(random.random() * 50)
        res = requests.put(url=url, headers=headers2)
        msg += f'领取奖励：{res.json()["message"]}\n'
        print(f'1', res.text)
    return msg
if __name__ == "__main__":
    title = "希沃学院任务测试(多账号)"
    contents = []
    # 假设 accounts 是一个已定义好的可迭代对象，里面包含类似字典形式的账号信息（有 "username" 等键）
    for account in accounts:
        token_value = token(account)
        # 只调用一次huoqujinrijifen函数，并将结果保存到变量jinri_info中
        jinri_info = huoqujinrijifen(token_value)
        if jinri_info[0] > 30:
            contents.append(f"{account['username']}的今日积分：{jinri_info[0]}\n当前积分：{jinri_info[1]}\n今日积分明细\n{jinri_info[2]}\n跳过本次执行!!\n\n")
            print(contents)
        else:
            b = f'\n--------🌸签到任务开始({account["username"]})🌸--------\n'
            c = f'--------🌸查询信息开始({account["username"]})🌸--------\n'
            e = f'\n--------🌸领取奖励开始({account["username"]})🌸--------\n'
            h = f'\n--------🌸本次运行信息({account["username"]})🌸--------\n'
            d = '\n'
            j = '🌹' * 16
            # title = '希沃学院任务测试'
            xianzaijifen = chaxun(token_value)[1]
            content = f'{c}{chaxun(token_value)[0]}{b}{qiandao(token_value)}{d}{d}{kanshipin(token_value)}{d}{e}{lingqujiangli(token_value)}{d}{h}本次获得积分：{chaxun(token_value)[1] - xianzaijifen}{d}{d}{j}{d}{d}'
            contents.append(content)
    # print(contents)
    contents_str = "".join(contents)
    notify2.send(title, contents_str)
    # lingqujiangli(token)